/*
 * @Author: szx
 * @Date: 2021-10-29 11:29:56
 * @LastEditTime: 2021-10-29 11:38:29
 * @Description:
 * @FilePath: \leetcode\344\344.cpp
 */
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
// class Solution {
//    public:
//     void reverseString(vector<char>& s) { reverse(s.begin(), s.end()); }
// };

class Solution {
   public:
    void reverseString(vector<char>& s) {
        int l = 0, r = s.size() - 1;
        while (l < r) {
            swap(s[l++], s[r--]);
        }
    }
};